package cn.sxt.userscenter.common.util;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.springframework.stereotype.Component;

@Component("fileUtil")
public class FileUtil {
	public String readFile(InputStream is){
		StringBuffer sb=new StringBuffer();
		BufferedReader br=null;
		try {
			br=new BufferedReader(new InputStreamReader(is,"utf-8"));
			String line="";
			while((line=br.readLine()) !=null){
				sb.append(line);
			}						
		} catch (Exception e) {
			ConstatFinalUtil.LOGGER.info("读取文件出错",e);			
		}		
		return sb.toString();
	}
}
